package com.bawei.module_home.model.api


import com.bawei.lib_common.entity.ResponseEntity
import com.bawei.lib_common.entity.SendCommentBody
import com.bawei.lib_common.entity.SendCommentEntity
import com.bawei.module_home.model.entity.SimpleTypeEntity
import com.bawei.lib_common.entity.SimpleVideoEntityItem
import com.bawei.lib_common.entity.VideoCommentEntity
import com.bawei.lib_common.entity.VideoCommentEntityItem
import com.bawei.module_home.net.API
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Query

interface HomeApi {
    /**
     * 获取视频类型信息接口
     */
    @GET(API.GET_SIMPLE_TYPE)
    suspend fun getSimpleType(): ResponseEntity<List<SimpleTypeEntity>>
    /**
     * 根据ChannelId获取对应视频信息
     */
    @GET(API.GET_SIMPLE_VIDEO_BY_CHANNEL_ID)
    suspend fun getSimpleVideoByChannelId(@Query(API.CHANNEL_ID) channelId: String, @Query(API.PAGE) page: Int, @Query(API.PAGE_SIZE) pageSize: Int): ResponseEntity<List<SimpleVideoEntityItem>>
    /**
     * 获取视频评论接口
     */
    @GET(API.GET_COMMENT_BY_USER_ID)
    suspend fun getCommentByUserId(@Query(API.DATATYPE) datatype: Int, @Query(API.ITEMID) itemid: String): ResponseEntity<List<VideoCommentEntityItem>>
    /**
     * 发布视频评论
     */
    @POST(API.SEND_COMMENT)
    suspend fun sendComment(@Body body: SendCommentBody): ResponseEntity<SendCommentEntity>
    /**
     * 删除视频评论
     */
    @DELETE(API.DELETE_COMMENT)
    suspend fun deleteComment(@Query(API.ID) commentid: Int): ResponseEntity<Boolean>
    /**
     * 点赞视频评论
     */
    @POST(API.AGREE_COMMENT)
    suspend fun agreeComment(@Query(API.COMMENTID) commentid: Int): ResponseEntity<Boolean>
    /**
     * 取消点赞视频评论
     */
    @POST(API.CANCEL_AGREE_COMMENT)
    suspend fun cancelAgreeComment(@Query(API.COMMENTID) commentid: Int): ResponseEntity<Boolean>

    @PUT("/account/modifyAccountAmount")
    suspend fun updateAccountAmount(@Query("id") id: Int, @Query("nm") nm: String): ResponseEntity<Boolean>
}